<?php

$userid = get_loggedin_userid();
$offset = 0;
$limit  = 10;
$keywords = get_input('keywords');
$category_id = get_input('category_id');
$arr_keywords = get_array_from_keywords($keywords);

$interests = combo_get_interests_by_name_and_category_id($userid, $arr_keywords, $category_id, $limit, $offset);

$return = array();
foreach($interests as $interest) {
    $return[] = to_interest_array($interest);
}

echo json_encode(export_result(200, $return));

?>